package org.rc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.rc.entity.SxzjChannel;
import org.rc.mapper.SxzjChannelMapper;
import org.rc.service.SxzjChannelService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SxzjChannelServiceImpl extends ServiceImpl<SxzjChannelMapper, SxzjChannel>  implements SxzjChannelService {

    @Override
    public void addSxzjChannels(List<SxzjChannel> channels) {
        this.saveBatch(channels);
    }

    @Override
    public void deleteChannelsBySxzjId(Long sxzjId) {
        QueryWrapper<SxzjChannel> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("sxzj_id",sxzjId);
        this.remove(queryWrapper);
    }

    @Override
    public List<SxzjChannel> sxzjChannels(Long sxzjId) {
        QueryWrapper<SxzjChannel> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("sxzj_id",sxzjId);
        return list(queryWrapper);
    }

    @Override
    public void deleteBySxjIds(List<Long> sxjIds) {
        QueryWrapper<SxzjChannel> queryWrapper = new QueryWrapper<>();
        queryWrapper.in("sxj_id",sxjIds);
        this.remove(queryWrapper);
    }

    @Override
    public void deleteBySxzjIds(List<Long> sxzjIds) {
        QueryWrapper<SxzjChannel> queryWrapper = new QueryWrapper<>();
        queryWrapper.in("sxzj_id",sxzjIds);
        this.remove(queryWrapper);
    }
}
